function pb_arr = pb_check(exp,userID,mouse_id)

fb_lt_win=1500;
fb_rt_win=500;

pb_lt_win=1500;
pb_rt_win=1000;

adata_dir='\\argon.fmi.ch\keller.g\AData\';
[~,host] = dos('hostname');
if ~isempty(regexp(host,'rig1-aux', 'once'))
    data_dir='D:\tempData\S1-T';
else
    data_dir=['\\KELLER-RIG1-ANA\RawData\' userID '\' mouse_id '\S1-T'];
end

if length(exp)<2
    data=load_lvd([data_dir num2str(exp) '.lvd']);
    
%     checkAux(exp);
    
    [~,~,velP_ind,velM_ind,~,~]=get_vel_ind_from_adata(data);
    
    % figure;plot(velP_ind)
    % hold on
    % plot(data(3,:)/2,'color','green')
    % plot(velM_ind,'color','red')
    % drawnow
    
    ori_pert=round(data(3,:)*2);
    pert=abs(ori_pert);
    pert=diff(pert)>0;
    
    cnt=1;
    pert_pb=[];
    for und=1:length(pert)
        if pert(und)>0
            fb_beg=und-fb_lt_win;
            fb_las=und+fb_rt_win;
            if fb_beg<0
                fb_beg=1;
            end
            if fb_las>length(pert)
                fb_las=length(pert);
            end
            pb_beg=und-pb_lt_win;
            pb_las=und+pb_rt_win;
            if pb_beg<0
                pb_beg=1;
            end
            if pb_las>length(pert)
                pb_las=length(pert);
            end
            if sum(velP_ind(fb_beg:fb_las))==sum([fb_lt_win fb_rt_win 1])
                if sum(velM_ind(pb_beg:pb_las))==0
                    pert_pb(cnt)=ori_pert(und+1);
                    cnt=cnt+1;
                end
            end
        end
    end
    if ~isempty(pert_pb)
        un_val=unique(pert_pb);
        per_arr=[];
        for ond=1:length(un_val)
            per_arr(ond,1)=un_val(ond);
            per_arr(ond,2)=sum(pert_pb==un_val(ond));
        end
        pb_arr = per_arr;
        figure;
        bar(pb_arr(:,1),pb_arr(:,2))
        ylim([0 max(pb_arr(:,2))]);
        xlim([-6.5 7.5]);
        set(gca,'xtick',-6:1:7)
    else
        disp('No playback pert')
        disp(['Feedback pert window: ' num2str(fb_lt_win) 's - pert onset - ' num2str(fb_rt_win) 's'])
        disp(['Playback pert window: ' num2str(pb_lt_win) 's - pert onset - ' num2str(pb_rt_win) 's'])
    end
else
    cnt=1;
    pert_pb=[];
    for ynd=1:length(exp)
        data=load_lvd([data_dir num2str(exp(ynd)) '.lvd']);
        
        [~,~,velP_ind,velM_ind,~,~]=get_vel_ind_from_adata(data);
        
        %         figure;plot(velP_ind)
        %         hold on
        %         plot(data(3,:)/2,'color','green')
        %         plot(velM_ind,'color','red')
        %         drawnow
        
        ori_pert=round(data(3,:)*2);
        pert=abs(ori_pert);
        pert=diff(pert)>0;
        
        for und=1:length(pert)
            if pert(und)>0
                fb_beg=und-fb_lt_win;
                fb_las=und+fb_rt_win;
                if fb_beg<0
                    fb_beg=1;
                end
                if fb_las>length(pert)
                    fb_las=length(pert);
                end
                pb_beg=und-pb_lt_win;
                pb_las=und+pb_rt_win;
                if pb_beg<0
                    pb_beg=1;
                end
                if pb_las>length(pert)
                    pb_las=length(pert);
                end
                if sum(velP_ind(fb_beg:fb_las))==sum([fb_lt_win fb_rt_win 1])
                    if sum(velM_ind(pb_beg:pb_las))==0
                        pert_pb(cnt)=ori_pert(und+1);
                        cnt=cnt+1;
                    end
                end
            end
        end
    end
    if ~isempty(pert_pb)
        un_val=unique(pert_pb);
        per_arr=[];
        for ond=1:length(un_val)
            per_arr(ond,1)=un_val(ond);
            per_arr(ond,2)=sum(pert_pb==un_val(ond));
        end
        pb_arr = per_arr;
        figure;
        bar(pb_arr(:,1),pb_arr(:,2))
        ylim([0 max(pb_arr(:,2))]);
        xlim([-6.5 7.5]);
        set(gca,'xtick',-6:1:7)
    else
        disp('No playback pert')
        disp(['Feedback pert window: ' num2str(fb_lt_win) 's - pert onset - ' num2str(fb_rt_win) 's'])
        disp(['Playback pert window: ' num2str(pb_lt_win) 's - pert onset - ' num2str(pb_rt_win) 's'])
    end
end